<!DOCTYPE html>
<html class="x-admin-sm">

{include file="common/static" /}
{include file="common/resources" /}
<style>

</style>
    <body>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-col-md12">
                            <div class="layui-card">
                                <div class="layui-card-header">入住信息</div>
                                <div class="layui-card-body ">
                                    <table class="layui-table" lay-skin="row" lay-size="sm">
                                        <tbody>
                                        <tr>
                                            <th>入住时间</th>
                                            <td>
                                                    <div class="layui-form layui-form-item">
                                                        <div class="layui-input-inline">
                                                            <input type="text" required="" lay-verify="required" value="{$list.in_time}"
                                                                   autocomplete="off" class="layui-input" readonly="readonly">
                                                        </div>
                                                        <div class="layui-input-inline">
                                                            <input type="text" required="" lay-verify="required" value="{$list.move_time}"
                                                                   autocomplete="off" class="layui-input" readonly="readonly">
                                                        </div>
                                                    </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>入住房间</th>
                                            <td>
                                                <div class="layui-form layui-form-item">
                                                    <div class="layui-input-inline">
                                                        <input type="text" required="" lay-verify="required" value="{$list.num_arr}"
                                                               autocomplete="off" class="layui-input" readonly="readonly">
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>房间数量</th>
                                            <td>
                                                <div class="layui-form layui-form-item">
                                                    <div class="layui-input-inline">
                                                        <input type="text" required="" lay-verify="required" value="{$list.count}"
                                                               autocomplete="off" class="layui-input" readonly="readonly">
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>明细</th>
                                            <td>
                                                <ul class="layui-row layui-col-space12 layui-this x-admin-carousel x-admin-backlog">
                                                    <li style="width: 100px; float: left">
                                                        <div href="javascript:;" class="x-admin-backlog-body">
                                                            <h3>总金额</h3>
                                                            <p>
                                                                <cite>{$list.income_details}</cite>
                                                            </p>
                                                        </div>
                                                    </li>
                                                    <li style="width: 100px;float: left"">
                                                        <div href="javascript:;" class="x-admin-backlog-body">
                                                            <h3>总定金</h3>
                                                            <p>
                                                                <cite>{$list.deposit_record}</cite>
                                                            </p>
                                                        </div>
                                                    </li>
                                                    <li style="width: 100px;float: left"">
                                                        <div href="javascript:;" class="x-admin-backlog-body">
                                                            <h3>活动折扣</h3>
                                                            <p>
                                                                <cite>{$list.activity_price}</cite>
                                                            </p>
                                                        </div>
                                                    </li>
                                                    <li style="width: 100px;float: left"">
                                                        <div href="javascript:;" class="x-admin-backlog-body">
                                                            <h3>会员折扣</h3>
                                                            <p>
                                                                <cite>{$list.member_price}</cite>
                                                            </p>
                                                        </div>
                                                    </li>
                                                    <li style="width: 100px;float: left"">
                                                        <div href="javascript:;" class="x-admin-backlog-body">
                                                            <h3>实付房费</h3>
                                                            <p>
                                                                <cite>{$list.price_receivable}</cite>
                                                            </p>
                                                        </div>
                                                    </li>
                                                </ul>
                                            </td>
                                        </tr>

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>

                        <div class="layui-col-md12">
                            <div class="layui-card">
                                <div class="layui-card-header">
                                    退款
                                    <div style="float: right;">
                                        <button type="button" class="layui-btn" onclick="current()">当前房间退房</button>
                                        <button type="button" class="layui-btn" onclick="alls()">所有房间退房</button>
                                        <button type="button" class="layui-btn">打印数据</button>
                                    </div>

                                </div>
                                <div class="layui-card-body ">
                                    <table class="layui-table" lay-skin="row" lay-size="sm">
                                        <tbody>
                                        <tr>
                                            <th>房费退款</th>
                                            <td>
                                                <div class="layui-form layui-form-item">
                                                    <div class="layui-input-inline">
                                                        <input type="text" id="room_rate" required="" lay-verify="required" value="0"
                                                               autocomplete="off" class="layui-input">
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>押金退款</th>
                                            <td>
                                                <div class="layui-form layui-form-item">
                                                    <div class="layui-input-inline">
                                                        <input type="text"  id="deposit" required="" lay-verify="required" value="0"
                                                               autocomplete="off" class="layui-input">
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>退款理由</th>
                                            <td>
                                                <div class="layui-form layui-form-item">
                                                    <div class="layui-input-inline">
                                                        <input type="text" id="reason" required="" lay-verify="required"
                                                               autocomplete="off" class="layui-input">
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>备注</th>
                                            <td>
                                                <div class="layui-form layui-form-item">
                                                    <textarea name="desc" id="desc" placeholder="请输入内容" class="layui-textarea"></textarea>
                                                </div>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </body>

<script>
    //当前房间退款
    function current() {
        $.ajax({
            type:"post",
            url: "{:url('home/atrial/out_room')}",
            data: {
                id:{$id},
                room_rate:$('#room_rate').val(),
                deposit:$('#deposit').val(),
                reason:$('#reason').val(),
                desc:$('#desc').val()
            },
            success: function(data){
                toastr.error(data.msg);
                if(data.code == 100){
                    voice('return');
                    setTimeout(function () {
                        layer.closeAll();
                        parent.location.reload();
                    },1500);
                }
            }});
    }
    //所有房间退款
    function alls() {
        $.ajax({
            type:"post",
            url: "{:url('home/atrial/out_room')}",
            data: {
                id:{$id},
                room_rate:$('#room_rate').val(),
                deposit:$('#deposit').val(),
                reason:$('#reason').val(),
                desc:$('#desc').val(),
                all:'1'
            },
            success: function(data){
                toastr.error(data.msg);
                if(data.code == 100){
                    voice('return');
                    setTimeout(function () {
                        layer.closeAll();
                        parent.location.reload();
                    },1500);
                }
            }});
    }

</script>


</html>